home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
prog
/
dnalib59.arj
/
EDITBOX.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-11-17
|
3KB
|
126 lines
DECLARE SUB LineEdit(Allow$,Text$,Mouse%,MouseRow%,MouseCol%,Fill%,Row%,Col%,EditKey%,Attr%)
DECLARE SUB Popwind(Title$,Toprow%,Leftcolumn%,Bottomrow%,Rightcolumn%,Attr%,Shadow%,Border%)
DECLARE SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
DECLARE SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%)
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
DECLARE SUB HideCursor()
DECLARE SUB ShowCursor()
SUB EditBox(Prompt$,Text$,Allow$,Mouse%,Fill%,Location%,ButtonAttr%,TextAttr%,Attr%,Shadow%,Border%)PUBLIC
CalcByte Attr%,FGround%,BGround%
CalcByte ButtonAttr%,BtFG%,BtBG%
IF Mouse% THEN HideCursor
Finished% = 0
LeftColumn% = 40 - ((LEN(Prompt$) + LEN(Text$) + 5) \ 2)
RightColumn% = LeftColumn% + (LEN(Prompt$) + LEN(Text$) + 4)
SaveScreen EdScreen$,Location%,LeftColumn%,Location% + 5,RightColumn%,Shadow%
Popwind Title$,Location%,LeftColumn%,Location% + 5,RightColumn%,Attr%,Shadow%,Border%
COLOR FGround%,BGround%
LOCATE Location% + 1,LeftColumn% + 2,0
PRINT Prompt$;
Row% = Location% + 3
Col% = LeftColumn% + 3
IF Mouse% THEN
COLOR FGround%,BGround%
LOCATE Location%,LeftColumn% + 2,0
PRINT CHR$(91,254,93);
END IF
COLOR BtFG%,BtBG%
LOCATE Row%, Col%,0
PRINT " Ok ";
COLOR 0,BGround%
LOCATE Row%, Col% + 4,0
PRINT "▄";
COLOR 0,BGround%
LOCATE Row% + 1,Col% + 1,0
PRINT "▀▀▀▀";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 9,0
PRINT " Esc ";
COLOR 0,BGround%
LOCATE Row%,Col% + 14,0
PRINT "▄";
COLOR 0,BGround%
LOCATE Row% + 1,Col% + 10,0
PRINT "▀▀▀▀▀"
DO
LineEdit Allow$,Text$,Mouse%,MouseRow%,MouseCol%,Fill%,Location% + 1,LeftColumn% + LEN(Prompt$) + 3,EditKey%,TextAttr%
IF Mouse% THEN 'stop here and check if exit was with mouse
ShowCursor
IF Row% = MouseRow% THEN
SELECT CASE MouseCol%
CASE Col% TO Col% + 3
Editkey% = 13
Finished% = 1
CASE Col% + 9 TO Col% + 13
Editkey% = 27
Finished% = 1
END SELECT
ELSEIF Location% = MouseRow% THEN
IF MouseCol% = LeftColumn% + 3 THEN
Editkey% = 27
Finished% = 1
END IF
ELSE
IF Editkey% = 13 OR Editkey% = 27 THEN
Finished% = 1
END IF
END IF
ELSE
IF Editkey% = 13 OR Editkey% = 27 THEN Finished% = 1
END IF
LOOP UNTIL Finished%
SELECT CASE Editkey%
CASE 13 'Ok
IF Mouse% THEN HideCursor
COLOR FGround%,BGround%
LOCATE Row%,Col%,0
PRINT " ";
LOCATE Row% + 1,Col% + 1,0
PRINT " ";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 1,0
PRINT " Ok "
CASE 27 'Esc
IF Mouse% THEN HideCursor
COLOR FGround%,BGround%
LOCATE Row%,Col% + 9,0
PRINT " ";
LOCATE Row% + 1,Col% + 10,0
PRINT " ";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 10,0
PRINT " Esc "
END SELECT
IF Mouse% THEN ShowCursor
DELAY .5
IF Mouse% THEN HideCursor
RestoreScreen EdScreen$,Location%,LeftColumn%
END SUB